/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.fpt.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author TuanAnh
 */
@Entity
@Table(name = "BillAll")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "BillAll.findAll", query = "SELECT b FROM BillAll b"),
    @NamedQuery(name = "BillAll.findByBillId", query = "SELECT b FROM BillAll b WHERE b.billId = :billId"),
    @NamedQuery(name = "BillAll.findByDatePay", query = "SELECT b FROM BillAll b WHERE b.datePay = :datePay"),
    @NamedQuery(name = "BillAll.findByTotal", query = "SELECT b FROM BillAll b WHERE b.total = :total"),
    @NamedQuery(name = "BillAll.findByDateCome", query = "SELECT b FROM BillAll b WHERE b.dateCome = :dateCome"),
    @NamedQuery(name = "BillAll.findByNumberPeople", query = "SELECT b FROM BillAll b WHERE b.numberPeople = :numberPeople")})
public class BillAll implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "billId")
    private String billId;
    @Size(max = 10)
    @Column(name = "datePay")
    private String datePay;
    @Column(name = "total")
    private Integer total;
    @Size(max = 10)
    @Column(name = "dateCome")
    private String dateCome;
    @Column(name = "numberPeople")
    private Integer numberPeople;
    @JoinColumn(name = "reserDetailId", referencedColumnName = "reserDetailId")
    @ManyToOne
    private RentDetail reserDetailId;
    @JoinColumn(name = "employeeName", referencedColumnName = "employeeName")
    @ManyToOne(optional = false)
    private Employee employeeName;

    public BillAll() {
    }

    public BillAll(String billId) {
        this.billId = billId;
    }

    public String getBillId() {
        return billId;
    }

    public void setBillId(String billId) {
        this.billId = billId;
    }

    public String getDatePay() {
        return datePay;
    }

    public void setDatePay(String datePay) {
        this.datePay = datePay;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public String getDateCome() {
        return dateCome;
    }

    public void setDateCome(String dateCome) {
        this.dateCome = dateCome;
    }

    public Integer getNumberPeople() {
        return numberPeople;
    }

    public void setNumberPeople(Integer numberPeople) {
        this.numberPeople = numberPeople;
    }

    public RentDetail getReserDetailId() {
        return reserDetailId;
    }

    public void setReserDetailId(RentDetail reserDetailId) {
        this.reserDetailId = reserDetailId;
    }

    public Employee getEmployeeName() {
        return employeeName;
    }

    public void setEmployeeName(Employee employeeName) {
        this.employeeName = employeeName;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (billId != null ? billId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BillAll)) {
            return false;
        }
        BillAll other = (BillAll) object;
        if ((this.billId == null && other.billId != null) || (this.billId != null && !this.billId.equals(other.billId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.fpt.entity.BillAll[ billId=" + billId + " ]";
    }
    
}
